package com.lhb.aop;

import org.aspectj.lang.annotation.*;

import java.util.logging.Logger;

/**
 * @Program: spring
 * @Description:
 * @Author: LHB
 * @Version: v0.0.1
 * @Time: 2021-09-01 19:59
 **/
@Aspect
public class AspectConfig {

	private Logger logger = Logger.getLogger(this.getClass().getName());

	@Before("execution(* com.lhb.aop.Calculate.*(..))")
	public void beforeAdvice() {
		logger.info("计算前....");
	}

	@After("execution(* com.lhb.aop.Calculate.*(..))")
	public void afterAdvice() {
		logger.info("计算后...");
	}

	@Around("execution(* com.lhb.aop.Calculate.*(..))")
	public void aroundAdvice() {
		logger.info("环绕通知....");
	}

	@AfterReturning("execution(* com.lhb.aop.Calculate.*(..))")
	public void afterReturning() {
		logger.info("方法返回前...");
	}

	@AfterThrowing("execution(* com.lhb.aop.Calculate.*(..))")
	public void afterThrowing() {
		logger.info("异常通知");
	}
}
